package com.wwf.util;

import org.I0Itec.zkclient.ZkClient;

/**
 * @author wwf
 * @date 2021年01月14日 14:09:08
 */
public class ZookeeperClient {
    private static String node="/provider";
    private  ZkClient zkClient;//zookeeper客户端实例
    public ZkClient getZkClient() {
        return zkClient;
    }
    public static String getNode(){
        return node;
    }
    public ZookeeperClient(String zkServers,int connectionTimeout) {
        this.zkClient = new ZkClient(zkServers,connectionTimeout);
        if(!this.zkClient.exists(node)) this.zkClient.createPersistent(node);
    }

}
